<div class="layuimini-container">
    <div class="layuimini-main">
        <fieldset id="searchFieldset_currentTable" class="table-search-fieldset layui-hide">
            <legend>{:lang("common.condition_search")}</legend>
            <form class="layui-form layui-form-pane form-search">
                <div class="layui-form-item layui-inline">
                    <label class="layui-form-label">{:lang("common.start_month")}</label>
                    <div class="layui-input-inline">
                        <input name="coll_collect_month_ge" class="layui-input cssMonth"
                               placeholder="{:lang('common.choose')}{:lang('common.start_month')}"
                               value="{$param.coll_collect_month_ge|default=''}">
                    </div>
                </div>

                <div class="layui-form-item layui-inline">
                    <label class="layui-form-label">{:lang("common.end_month")}</label>
                    <div class="layui-input-inline">
                        <input name="coll_collect_month_le" class="layui-input cssMonth"
                               placeholder="{:lang('common.choose')}{:lang('common.end_month')}"
                               value="{$param.coll_collect_month_le|default=''}">
                    </div>
                </div>

                <div class="layui-form-item layui-inline">
                    <label class="layui-form-label">{:lang("custom.name")}</label>
                    <div class="layui-input-inline">
                        <select name="coll_custom_id_eq" lay-search>
                            <option value="">{:lang("common.choose")}{:lang("custom.name")}</option>
                            {foreach :getMyCustomList() as $val}
                            <option value="{$val.id}" {if $val.id==$param.coll_custom_id_eq}selected{/if}
                            >{$val.number}{$val.name}
                            </option>
                            {/foreach}
                        </select>
                    </div>
                </div>

                <div class="layui-form-item layui-inline">
                    <label class="layui-form-label">{:lang("ratio.assigner")}</label>
                    <div class="layui-input-inline">
                        <select name="r_assigner_id_eq" lay-search>
                            <option value="">{:lang("common.choose")}{:lang("ratio.assigner")}</option>
                            {foreach :getAccountingList() as $val}
                            <option value="{$val.id}" {if $val.id==$param.r_assigner_id_eq}selected{/if}
                            >{$val.name}
                            </option>
                            {/foreach}
                        </select>
                    </div>
                </div>

                <div class="layui-form-item layui-inline" style="margin-left:50px">
                    <button type="submit" class="layui-btn layui-btn-normal" data-type="tableSearch"
                            lay-submit lay-filter="search_currentTable">{:lang("common.btn_search")}
                    </button>
                </div>
            </form>
        </fieldset>

        <table id="currentTable"
               data-auth-print="{:auth(request()->controller().'/print')}"
               data-auth-export="{:auth(request()->controller().'/export')}">
        </table>
    </div>
</div>
<script>
    layui.use(['myApp'], function () {
        var myCommon = layui.myCommon;
        myCommon.table.render({
            where: myCommon.generateCondition()
            , totalRow: true
            , limit: "{$param.limit|default='15'}"
            , cols: [[
                {field: '_month', width: 70, title: '{:lang("common.month")}', sort: true}
                , {field: 'number', width: 105, title: '{:lang("custom.number")}', sort: true}
                , {field: 'custom_name', minWidth: 120, title: '{:lang("custom.name")}', sort: true}
                , {field: 'assigner_name', width: 105, title: '{:lang("ratio.assigner")}', sort: true}
                , {field: 'ratio', width: 105, title: '{:lang("ratio.ratio")}', sort: true}
                , {field: 'total_money', width: 105, title: '{:lang("ratio.total_money")}', sort: true}
            ]]
            , done: function (res) {
                myCommon.tableTotal(this, res.data, ['total_money']);
            }
        });
        myCommon.listen();
    });
</script>
